package org.wutopia.rocketmq.exsample;

import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.wutopia.rocketmq.exsample.sdgasdg.OrderEvent;
import org.wutopia.rocketmq.exsample.sdgasdg.OrderProducer;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@RestController
@AllArgsConstructor
public class msdgXCast {

    OrderProducer orderProducer;

    @GetMapping("/mq")
    void get() {
        OrderEvent orderEvent = new OrderEvent();
        orderEvent.setAmount(new BigDecimal(124534));
        orderEvent.setOrderId("sdgasdg");
        orderEvent.setCreateTime(LocalDateTime.now());

        orderProducer.sendDelayedOrder(orderEvent, 2);
    }
}
